//
//  GRXLoginRegistController.m
//  1-MushroomStreet-自定义tabbar
//
//  Created by xmg on 15/12/21.
//  Copyright © 2015年 grx. All rights reserved.
//

#import "GRXLoginRegistController.h"
#import "GRXOAuthController.h"
#import "GRXLoginView.h"
#import "UserAccount.h"

@interface GRXLoginRegistController ()



@end

@implementation GRXLoginRegistController

- (void)loadView{

    //判断用户是否登录,让子控件显示不同的界面
    self.isLogin = [[[UserAccount alloc] init] isLogin];
//    self.isLogin = NO;
    self.isLogin ? [super loadView] : [self setUpLoginView];
    
}

- (void)setUpLoginView{
    GRXLoginView *loginView = [GRXLoginView grx_loginView];
    self.view = loginView;
}


- (void)viewDidLoad {
    [super viewDidLoad];

}


- (IBAction)sinaLoginClick:(id)sender {

    GRXOAuthController *oauthController = [[GRXOAuthController alloc] init];
    
    //包装成导航控制器
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:oauthController];
    
    [self presentViewController:nav animated:YES completion:nil];
}

@end
